\(\int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx\) [148]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 30 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=-\frac {\cot ^2(a+b x)}{16 b}+\frac {\log (\tan (a+b x))}{8 b} \]

[Out]

-1/16*cot(b*x+a)^2/b+1/8*ln(tan(b*x+a))/b

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4372, 2700, 14} \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=\frac {\log (\tan (a+b x))}{8 b}-\frac {\cot ^2(a+b x)}{16 b} \]

[In]

Int[Cos[a + b*x]^2*Csc[2*a + 2*b*x]^3,x]

[Out]

-1/16*Cot[a + b*x]^2/b + Log[Tan[a + b*x]]/(8*b)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2700

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 4372

Int[(cos[(a_.) + (b_.)*(x_)]*(e_.))^(m_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/e^p, Int[(e*Cos
[a + b*x])^(m + p)*Sin[a + b*x]^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{8} \int \csc ^3(a+b x) \sec (a+b x) \, dx \\ & = \frac {\text {Subst}\left (\int \frac {1+x^2}{x^3} \, dx,x,\tan (a+b x)\right )}{8 b} \\ & = \frac {\text {Subst}\left (\int \left (\frac {1}{x^3}+\frac {1}{x}\right ) \, dx,x,\tan (a+b x)\right )}{8 b} \\ & = -\frac {\cot ^2(a+b x)}{16 b}+\frac {\log (\tan (a+b x))}{8 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.43 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=\frac {1}{8} \left (-\frac {\csc ^2(a+b x)}{2 b}-\frac {\log (\cos (a+b x))}{b}+\frac {\log (\sin (a+b x))}{b}\right ) \]

[In]

Integrate[Cos[a + b*x]^2*Csc[2*a + 2*b*x]^3,x]

[Out]

(-1/2*Csc[a + b*x]^2/b - Log[Cos[a + b*x]]/b + Log[Sin[a + b*x]]/b)/8

Maple [A] (verified)

Time = 0.92 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.80

method result size
default \(\frac {-\frac {1}{2 \sin \left (x b +a \right )^{2}}+\ln \left (\tan \left (x b +a \right )\right )}{8 b}\) \(24\)
risch \(\frac {{\mathrm e}^{2 i \left (x b +a \right )}}{4 b \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )}{8 b}-\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{8 b}\) \(63\)
parallelrisch \(-\frac {\sec \left (x b +a \right )^{2} \csc \left (x b +a \right )^{2} \left (\ln \left (\sqrt {\tan \left (x b +a \right )}\right ) \cos \left (4 x b +4 a \right )+\cos \left (2 x b +2 a \right )+\cos \left (4 x b +4 a \right )-\ln \left (\sqrt {\tan \left (x b +a \right )}\right )\right )}{32 b}\) \(71\)

[In]

int(cos(b*x+a)^2/sin(2*b*x+2*a)^3,x,method=_RETURNVERBOSE)

[Out]

1/8/b*(-1/2/sin(b*x+a)^2+ln(tan(b*x+a)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (26) = 52\).

Time = 0.26 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.17 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=-\frac {{\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (\cos \left (b x + a\right )^{2}\right ) - {\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (-\frac {1}{4} \, \cos \left (b x + a\right )^{2} + \frac {1}{4}\right ) - 1}{16 \, {\left (b \cos \left (b x + a\right )^{2} - b\right )}} \]

[In]

integrate(cos(b*x+a)^2/sin(2*b*x+2*a)^3,x, algorithm="fricas")

[Out]

-1/16*((cos(b*x + a)^2 - 1)*log(cos(b*x + a)^2) - (cos(b*x + a)^2 - 1)*log(-1/4*cos(b*x + a)^2 + 1/4) - 1)/(b*
cos(b*x + a)^2 - b)

Sympy [F(-1)]

Timed out. \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=\text {Timed out} \]

[In]

integrate(cos(b*x+a)**2/sin(2*b*x+2*a)**3,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (26) = 52\).

Time = 0.22 (sec) , antiderivative size = 656, normalized size of antiderivative = 21.87 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=\frac {4 \, \cos \left (4 \, b x + 4 \, a\right ) \cos \left (2 \, b x + 2 \, a\right ) - 8 \, \cos \left (2 \, b x + 2 \, a\right )^{2} + {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, a\right ) + \sin \left (2 \, a\right )^{2}\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 8 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right )}{16 \, {\left (b \cos \left (4 \, b x + 4 \, a\right )^{2} + 4 \, b \cos \left (2 \, b x + 2 \, a\right )^{2} + b \sin \left (4 \, b x + 4 \, a\right )^{2} - 4 \, b \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) + 4 \, b \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, {\left (2 \, b \cos \left (2 \, b x + 2 \, a\right ) - b\right )} \cos \left (4 \, b x + 4 \, a\right ) - 4 \, b \cos \left (2 \, b x + 2 \, a\right ) + b\right )}} \]

[In]

integrate(cos(b*x+a)^2/sin(2*b*x+2*a)^3,x, algorithm="maxima")

[Out]

1/16*(4*cos(4*b*x + 4*a)*cos(2*b*x + 2*a) - 8*cos(2*b*x + 2*a)^2 + (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a
) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*s
in(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*a) + cos(2*a)^2 + sin(2*b*x)
^2 - 2*sin(2*b*x)*sin(2*a) + sin(2*a)^2) - (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 -
 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*co
s(2*b*x + 2*a) - 1)*log(cos(b*x)^2 + 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(a) + sin(a)^2)
 - (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)
^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*log(cos(b*x)^2 - 2*c
os(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(a) + sin(a)^2) + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) -
 8*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a))/(b*cos(4*b*x + 4*a)^2 + 4*b*cos(2*b*x + 2*a)^2 + b*sin(4*b*x + 4*a
)^2 - 4*b*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) + 4*b*sin(2*b*x + 2*a)^2 - 2*(2*b*cos(2*b*x + 2*a) - b)*cos(4*b*x
+ 4*a) - 4*b*cos(2*b*x + 2*a) + b)

Giac [A] (verification not implemented)

none

Time = 0.43 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.37 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=\frac {\frac {1}{\cos \left (b x + a\right )^{2} - 1} + \log \left (-\cos \left (b x + a\right )^{2} + 1\right ) - 2 \, \log \left ({\left | \cos \left (b x + a\right ) \right |}\right )}{16 \, b} \]

[In]

integrate(cos(b*x+a)^2/sin(2*b*x+2*a)^3,x, algorithm="giac")

[Out]

1/16*(1/(cos(b*x + a)^2 - 1) + log(-cos(b*x + a)^2 + 1) - 2*log(abs(cos(b*x + a))))/b

Mupad [B] (verification not implemented)

Time = 19.64 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.20 \[ \int \cos ^2(a+b x) \csc ^3(2 a+2 b x) \, dx=-\frac {\frac {\ln \left (\cos \left (a+b\,x\right )\right )}{8}-\frac {\ln \left ({\sin \left (a+b\,x\right )}^2\right )}{16}+\frac {1}{16\,{\sin \left (a+b\,x\right )}^2}}{b} \]

[In]

int(cos(a + b*x)^2/sin(2*a + 2*b*x)^3,x)

[Out]

-(log(cos(a + b*x))/8 - log(sin(a + b*x)^2)/16 + 1/(16*sin(a + b*x)^2))/b